package com.open.video.dao;

import com.open.capacity.common.model.SysRole;
import com.open.capacity.common.model.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @program: open-capacity-platform
 * @description:
 * @author: bellweather
 * @create: 2021-01-29 10:22
 **/

public interface VUserRoleDao {

    @Select("select r.id ,r.code, r.name, r.create_time createTime , r.update_time  updateTime   from sys_role_user ru inner join sys_role r on r.id = ru.role_id where ru.user_id = #{userId}")
    Set<SysRole> findRolesByUserId(Long userId);

    @Select("select * from sys_user where id = #{userId}")
    SysUser findUserById(Long userId);
}
